package fr.grassaud.hmvc.web.session;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class HMVCSessionFactoryLoaderListener extends HMVCSessionFactoryLoader implements ServletContextListener{

    private HMVCSessionFactoryLoader sessionLoader;
    
    @Override
    public void contextInitialized(ServletContextEvent sce) {
		this.sessionLoader = this;
	this.sessionLoader.initWebApplicationContext(sce.getServletContext());
	
    }

    @Override
    public void contextDestroyed(ServletContextEvent sce) {
	if (this.sessionLoader != null) {
		this.sessionLoader.closeHMVCSessionFactory(sce.getServletContext());
	}
	
    }

}
